package com.lxy.dataservice.controller;

import com.coxautodev.graphql.tools.GraphQLMutationResolver;
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.lxy.dataservice.entity.Durg;
import com.lxy.dataservice.service.DurgService;
import com.nip.db.mongodb.utils.tips.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * MemberController
 *
 * @author < a href=" ">BBB</ a>
 * @version v1.0.01
 * @date 2019-12-26 14:44
 */
@Component
public class DurgController implements GraphQLQueryResolver, GraphQLMutationResolver {
  @Autowired
  DurgService durgService;


  public Response saveDurg(Durg entity){
    return durgService.saveDurg(entity);
  }

  public Response updateDurg(Durg entity) {
    return durgService.updateDurg(entity);
  }

  public Durg findDurgById(String id) {
    return durgService.findDurgById(id);
  }

  public List<Durg> findDurgByTypeId(String id) {
    return durgService.findDurgByTypeId(id);
  }

  public List<Durg> findDurgByName(String name){
    return durgService.findAllByName(name);
  }

  public Response deleteDurg(String id){
    return durgService.deletDurg(id);
  }

  }
